package com.jerry.provider.service.impl;

import com.jerry.common.bean.Order;
import com.jerry.provider.dao.OrderDao;
import com.jerry.provider.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class OrderServiceImpl implements OrderService {

    @Autowired
    private OrderDao orderDao;

    @Override
    public List<Order> list() {
        return orderDao.findAll();
    }

    @Override
    public Order get(String orderNumber) {
        return orderDao.findByOrderNumber(orderNumber);
    }

    @Override
    public List<Order> getByUserId(long userId) {
        return orderDao.findByUserId(userId);
    }

}
